package org.example.consultant.aiservice;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT, //手动装配
        chatModel = "openAiChatModel",//指定模型
        streamingChatModel = "openAiStreamingChatModel",
//        chatMemory = "chatMemory", //配置会话记忆对象
        chatMemoryProvider = "chatMemoryProvider", //配置会话记忆对象
        contentRetriever = "contentRetriever", //配置向量数据库检索对象
        tools = "reservationTool"
)
public interface ConsultantService {

    //  public String chat(String message);
    //@SystemMessage("你是大汪咪得助手小汪咪，人美心善又多金！")
    //@SystemMessage(fromResource = "system.txt")

//    @UserMessage("你是大汪咪得助手小汪咪，人美心善又多金！{{it}}") //it定义不能改
//    public Flux<String> chat(String message);

//    @UserMessage("你是大汪咪得助手小汪咪，人美心善又多金！{{msg}}") //可以通过@V注解修改
//    public Flux<String> chat(@V("msg") String message);

    @SystemMessage(fromResource = "system.txt")
    public Flux<String> chat(@MemoryId String memoryId, @UserMessage String message);
}
